<template>
  <div class="content-box">
    <nav-title title="转正审批" routerLink="TodoList"/>
    <div class="regulations-box">
      <div class="title">基本信息</div>
      <v-base-info v-bind:baseInfo="baseInfo"></v-base-info>
    </div>
    <div class="regulations-box">
      <div class="title">详细信息</div>
      <v-detail-info v-bind:detailInfo="detailInfo"></v-detail-info>
    </div>

    <div class="regulations-box" >
      <div class="title" v-if="showProcessMoudle">流程信息</div>
      <div class="information" v-if="showProcessMoudle">
        <div class="info-cell" v-show="cPrcTypeRule.isDisplay">
          <div class="label"><span class="red">*</span>转正类型</div>
          <div class="value">
            <group>
              <popup-radio placeholder="请选择" :options="typeList" v-model="type" @on-show="getCertType" :readonly="!cPrcTypeRule.isEdit"></popup-radio>
            </group>
          </div>
        </div>

        <div class="info-cell" v-show="cPrcDtRule.isDisplay">
          <div class="label"><span class="red">*</span>转正日期</div>
          <div class="value">
            <group>
              <datetime value-text-align="left" placeholder="请选择" v-model="date" :readonly="!cPrcDtRule.isEdit"></datetime>
            </group>
          </div>
        </div>

        <div class="info-cell" v-show="cAssmRsltRule.isDisplay">
          <div class="label"><span class="red"></span>360测评成绩</div>
          <div class="value">
            <input type="text" placeholder="请填写..." v-model="cAssmRslt" :readonly="!cAssmRsltRule.isEdit">
          </div>
        </div>

        <div class="info-cell" v-show="cIsAdjRule.isDisplay">
          <div class="label"><span class="red"></span>是否调薪调岗</div>
          <div class="value">
            <group>
              <popup-radio placeholder="请选择" :options="yesOrNoList"
                           v-model="yesOrNo" :readonly="!cIsAdjRule.isEdit"
                           @on-hide="showOrHide"
              ></popup-radio>
            </group>
          </div>
        </div>
        <div v-show="showAdjust">
          <div class="info-cell" v-show="cAdjuJobcodeRule.isDisplay">
            <div class="label"><span class="red"></span>调整岗位</div>
            <div class="value">
              <group>
                <popup-radio placeholder="请选择" :options="jobList" v-model="job" @on-show="getJobType" :readonly="!cAdjuJobcodeRule.isEdit"></popup-radio>
              </group>
            </div>
          </div>

          <div class="info-cell" v-show="cAdjuSalaryRule.isDisplay">
            <div class="label"><span class="red"></span>调整后月固薪</div>
            <div class="value">
              <input type="text" placeholder="请填写..." v-model="cAdjuSalary" :readonly="!cAdjuSalaryRule.isEdit">
            </div>
          </div>

          <div class="info-cell" v-show="cBasePayRule.isDisplay">
            <div class="label"><span class="red"></span>调整后基本工资</div>
            <div class="value">
              <input type="text" placeholder="请填写..." v-model="cBasePay" :readonly="!cBasePayRule.isEdit">
            </div>
          </div>

          <div class="info-cell" v-show="cPostWageRule.isDisplay">
            <div class="label"><span class="red"></span>调整后岗位工资</div>
            <div class="value">
              <input type="text" placeholder="请填写..." v-model="cPostWage" :readonly="!cPostWageRule.isEdit">
            </div>
          </div>

          <div class="info-cell" v-show="cOvertimePayRule.isDisplay">
            <div class="label"><span class="red"></span>调整后加班工资</div>
            <div class="value">
              <input type="text" placeholder="请填写..." v-model="cOvertimePay" :readonly="!cOvertimePayRule.isEdit">
            </div>
          </div>

          <div class="info-cell" v-show="cMeritPayRule.isDisplay">
            <div class="label"><span class="red"></span>调整后绩效工资</div>
            <div class="value">
              <input type="text" placeholder="请填写..." v-model="cMeritPay" :readonly="!cMeritPayRule.isEdit">
            </div>
          </div>
        </div>

        </div>
        <div class="info-label" v-show="cIntervwRsltsRule.isDisplay">直接上级评价</div>
        <p class="info-cell clearfix" v-show="cIntervwRsltsRule.isDisplay">
          <label class="info-label-title"><span class="red">*</span>直接上级考核面谈结果记录</label>
        </p>
        <div class="info-label-text" v-show="cIntervwRsltsRule.isDisplay">
          <textarea placeholder="请在这里输入..." rows="5" v-model="cIntervwRslts" :readonly="!cIntervwRsltsRule.isEdit"></textarea>
        </div>

        <div class="info-label" v-if="showJudgeMoudle">用人单位负责人评价</div>
        <p class="info-cell clearfix" v-if="showJudgeMoudle">
          <label class="info-label-title">工作能力：</label>
        </p>

        <div class="info-cell" v-show="cLevelAbilityRule.isDisplay">
          <div class="label2">与内部同序列员工比较</div>
          <div class="value2">
            <group>
              <popup-radio placeholder="请选择" :options="gradeList1" v-model="grade1" @on-show="getGrade1" :readonly="!cLevelAbilityRule.isEdit"></popup-radio>
            </group>
          </div>
        </div>

        <div class="info-cell" v-show="cNoLevelAbilityRule.isDisplay">
          <div class="label2">若在职人员中无同序列员工比较</div>
          <div class="value2">
            <group>
              <popup-radio placeholder="请选择" :options="gradeList2" v-model="grade2" @on-show="getGrade2" :readonly="!cNoLevelAbilityRule.isEdit"></popup-radio>
            </group>
          </div>
        </div>

        <div class="info-cell" v-show="cWorkQualifiedRule.isDisplay">
          <div class="label2">对现任工作适任情况</div>
          <div class="value2">
            <group>
              <popup-radio placeholder="请选择" :options="gradeList3" v-model="grade3" @on-show="getGrade3" :readonly="!cWorkQualifiedRule.isEdit"></popup-radio>
            </group>
          </div>
        </div>

        <div class="info-cell" v-show="cWorkAttitudeRule.isDisplay">
          <div class="label2">试用期工作态度</div>
          <div class="value2">
            <group>
              <popup-radio placeholder="请选择" :options="gradeList4" v-model="grade4" @on-show="getGrade4" :readonly="!cWorkAttitudeRule.isEdit"></popup-radio>
            </group>
          </div>
        </div>

        <div class="info-cell" v-show="cCmprEvaltRule.isDisplay">
          <div class="label2">试用期综合评价</div>
          <div class="value2">
            <group>
              <popup-radio placeholder="请选择" :options="gradeList5" v-model="grade5" @on-show="getGrade5" :readonly="!cCmprEvaltRule.isEdit"></popup-radio>
            </group>
          </div>
        </div>

        <p class="info-cell clearfix" v-show="cChargeCommentsRule.isDisplay">
          <label class="info-label-title">负责人评语</label>
        </p>
        <div class="info-label-text" v-show="cChargeCommentsRule.isDisplay">
          <textarea placeholder="请在这里输入..." rows="5" v-model="cChargeComments" :readonly="!cChargeCommentsRule.isEdit"></textarea>
        </div>

      </div>


    <!-- 流程图 -->
    <div class="regulations-box">
      <div class="title">流程图</div>
      <v-flow-charts :transNum="cTransactionNbr"></v-flow-charts>
    </div>

    <!-- 审批意见 -->
    <div class="regulations-box">
      <div class="info-label">审批意见</div>
      <div class="info-label-text">
        <textarea placeholder="请在这里输入..." rows="5" v-model="cComments"></textarea>
      </div>
    </div>

    <div style="height: 50px"></div>
    <!-- 底部按钮 -->
    <div class="fix-btn">
      <button v-if="cApprovalSw == 'Y'" class="blue-btn" @click="doOperate('Approval')">同意</button>
      <button v-if="cAddSw == 'Y'" class="white-btn" @click="doOperate('AddStep')">
        <span>+</span> 加签</button>
      <span v-if="cPushbackAllSw == 'Y'" class="reject-main">
        <button class="yellow-btn" @click="popGroup">驳回</button>
        <transition name="slide-fade">
          <span v-if="showGroup" class="reject-group">
            <button class="yellow-btn" @click="doOperate('PushAllback')">重走</button>
            <button class="yellow-btn" @click="doOperate('Pushback')">不重走</button>
          </span>
        </transition>
      </span>
    </div>
  </div>
</template>

<script>
  import { Selector,Datetime, Group, PopupPicker,PopupRadio  } from 'vux'
  import { getFormal,getDicItem,getPrcType,getCompensateProcess,getJobDicItem,getFormalApprove } from '../../api/api'
  import { json2Form } from '../../util/http'
  import vBaseInfo from '../formalStaff/baseInfo'
  import vDetailInfo from '../formalStaff/detailInfo'
  import vFlowCharts from '../formalStaff/common/flowChart'

  export default {
    name: 'guide-to',
    components: {
      Group, Selector,Datetime, PopupPicker, vBaseInfo, vDetailInfo,PopupRadio, vFlowCharts
    },
    created(){
      this.cTransactionNbr = this.$route.query.cTransactionNbr;
      window.onclick = this.hideGroup;
      //转正审批信息
      this.getFormalInfo();
    },
    mounted(){

    },
    data() {
      return {

        typeList: [],
        type: '',

        date: '',

        cMeritPay: '',
        cOvertimePay: '',
        cPostWage: '',
        cBasePay: '',
        cAdjuSalary: '',
        cAdjuJobcode: '',
        cAssmRslt: '',
        jobList: [],
        job: '',

        yesOrNoList: [{value: '是', key: 'Y'},{value: '否', key: 'N'}],
        yesOrNo: '',
        showAdjust: false,
        gradeList1: [],
        grade1: '',
        gradeList2: [],
        grade2: '',
        gradeList3: [],
        grade3: '',
        gradeList4: [],
        grade4: '',
        gradeList5: [],
        grade5: '',

        cIntervwRslts: '',
        cChargeComments: '',

        baseInfo: {
          emplid: '',//员工ID
          nameDisplay: '',//姓名
          deptDescr: '',//部门
          rsFullName: '',
          jobcodeDescr: '',//岗位
          rsJobLevel: '',//职等
          lastHireDt: '',//入职日期
          cName: '',//带教人
          highestEducLv: '',//最高学历
          highestEducLvlValue: '',
          setidJobcode: '',//用来获取调整岗位列表
          cMajor: '',//专业
          cPerfArg: '',//月度绩效均分
          cHireAssm: '',//入职考核分数
          cFinancialStaff: '',//是否财务人员
        },
        detailInfo: {
          cJobContent: '',//主要工作经历和内容
          cAchievement: '',//取得的成绩
          cDefect: '',//存在的不足
          cPlansGoals: '',//后期计划及目标
          cOtherExplain: '',//其他说明
        },

        //
        authFileds: [],
        //转正类型
        cPrcTypeRule: {
          isDisplay: true,
          isEdit: false,
        },
        //转正日期
        cPrcDtRule: {
          isDisplay: true,
          isEdit: false,
        },
        //360测评成绩
        cAssmRsltRule: {
          isDisplay: true,
          isEdit: false,
        },

        //是否调岗调薪
        cIsAdjRule: {
          isDisplay: true,
          isEdit: false,
        },
        //调整岗位
        cAdjuJobcodeRule: {
          isDisplay: true,
          isEdit: false,
        },
        //调整后月固薪
        cAdjuSalaryRule:{
          isDisplay: true,
          isEdit: false,
        },

        //调整后基本工资
        cBasePayRule: {
          isDisplay: true,
          isEdit: false,
        },

        //调整后绩效工资
        cMeritPayRule: {
          isDisplay: true,
          isEdit: false,
        },
        //调整后岗位工资
        cPostWageRule: {
          isDisplay: true,
          isEdit: false,
        },
        //调整后加班工资
        cOvertimePayRule: {
          isDisplay: true,
          isEdit: false,
        },
        //直接上级评价
        cIntervwRsltsRule: {
          isDisplay: true,
          isEdit: false,
        },
        //与内部同序列员工比较
        cLevelAbilityRule: {
          isDisplay: true,
          isEdit: false,
        },
        //若在职人员中无同序列员工比较
        cNoLevelAbilityRule:{
          isDisplay: true,
          isEdit: false,
        },
        //对现任工作适任情况
        cWorkQualifiedRule: {
          isDisplay: true,
          isEdit: false,
        },
        //试用期工作态度
        cWorkAttitudeRule: {
          isDisplay: true,
          isEdit: false,
        },
        //试用期综合评价
        cCmprEvaltRule: {
          isDisplay: true,
          isEdit: false,
        },
        //负责人评语
        cChargeCommentsRule: {
          isDisplay: true,
          isEdit: false,
        },

        cApprovalSw: "",
        cDenySw: "",
        cPushbackAllSw: "",
        cAddSw: "",

        //按钮点击的参数
        cWfType: '',
        cTransactionNbr: '',
        cUserId: '',
        cComments: '',

        //流程信息模块是否显示，默认不显示
        showProcessMoudle: false,
        //用人单位负责评价模块是否显示，默认不显示
        showJudgeMoudle: false,
        showGroup: false

      }
    },
    methods: {
      getCertType(){
        //转正类型字典
        getPrcType().then(res=>{
          this.typeList = [];
          if(res && res.retCode === '000000'){
          for(let i=0; i<res.retData.length; i++){
            this.typeList.push({value: res.retData[i].descr,key: res.retData[i].cPrcType});
          }
        }
      }).catch(res=>{

        });
      },
      getJobType(){
        //调整岗位字典
        getJobDicItem({setId: 'XC001'}).then(res=>{
          this.jobList = [];
          if(res && res.retCode === '000000'){
          for(let i=0; i<res.retData.length; i++){
            this.jobList.push({value: res.retData[i].descr,key: res.retData[i].jobcode});
          }
        }
      }).catch(res=>{

        });
      },
      getGrade1(){
        //与内部同序列员工比较字典
        getDicItem({fileName: 'C_LEVEL_ABILITY'}).then(res=>{
          this.gradeList1 = [];
          if(res && res.retCode === '000000'){
          for(let i=0; i<res.retData.length; i++){
            this.gradeList1.push({value: res.retData[i].xlatshortname,key: res.retData[i].fieldvalue});
          }
        }
      }).catch(res=>{

        });
      },
      getGrade2(){
        //若在职人员中无同序列员工比较字典
        getDicItem({fileName: 'C_NO_LEVEL_ABILITY'}).then(res=>{
          this.gradeList2 = [];
          if(res && res.retCode === '000000'){
          for(let i=0; i<res.retData.length; i++){
            this.gradeList2.push({value: res.retData[i].xlatshortname,key: res.retData[i].fieldvalue});
          }
        }
      }).catch(res=>{

        });
      },
      getGrade3(){
        //对现任工作胜任情况字典
        getDicItem({fileName: 'C_WORK_QUALIFIED'}).then(res=>{
          this.gradeList3 = [];
          if(res && res.retCode === '000000'){
          for(let i=0; i<res.retData.length; i++){
            this.gradeList3.push({value: res.retData[i].xlatshortname,key: res.retData[i].fieldvalue});
          }
        }
      }).catch(res=>{

        });
      },
      getGrade4(){
        //试用期工作态度字典
        getDicItem({fileName: 'C_WORK_ATTITUDE'}).then(res=>{
          this.gradeList4 = [];
          if(res && res.retCode === '000000'){
          for(let i=0; i<res.retData.length; i++){
            this.gradeList4.push({value: res.retData[i].xlatshortname,key: res.retData[i].fieldvalue});
          }
        }
      }).catch(res=>{

        });
      },
      getGrade5(){
        //试用期综合评价字典
        getDicItem({fileName: 'C_CMPR_EVALT'}).then(res=>{
          this.gradeList5 = [];
          if(res && res.retCode === '000000'){
          for(let i=0; i<res.retData.length; i++){
            this.gradeList5.push({value: res.retData[i].xlatshortname,key: res.retData[i].fieldvalue});
          }
        }
      }).catch(res=>{

        });
      },
      getFormalInfo(){
        let params = {
          cTransactionNbr: this.cTransactionNbr
        };
        getFormal(params).then(res=>{

          if(res && res.retCode === '000000'){
            this.baseInfo.emplid = res.retData.emplid;
            this.baseInfo.nameDisplay = res.retData.nameDisplay;
            this.baseInfo.deptDescr = res.retData.deptDescr;
            this.baseInfo.rsFullName = res.retData.rsFullName;
            this.baseInfo.jobcodeDescr = res.retData.jobcodeDescr;
            this.baseInfo.rsJobLevel = res.retData.rsJobLevel;
            this.baseInfo.lastHireDt = res.retData.lastHireDt;
            this.baseInfo.cName = res.retData.cName;
            this.baseInfo.highestEducLv = res.retData.highestEducLv;
            this.baseInfo.highestEducLvlValue = res.retData.highestEducLvlValue;
            this.baseInfo.setidJobcode = res.retData.setidJobcode;
            this.baseInfo.cMajor = res.retData.cMajor;
            this.baseInfo.cPerfArg = res.retData.cPerfArg;
            this.baseInfo.cHireAssm = res.retData.cHireAssm;
            this.baseInfo.cFinancialStaff = res.retData.cFinancialStaff;

            this.detailInfo.cJobContent = res.retData.cJobContent;
            this.detailInfo.cAchievement = res.retData.cAchievement;
            this.detailInfo.cDefect = res.retData.cDefect;
            this.detailInfo.cPlansGoals = res.retData.cPlansGoals;
            this.detailInfo.cOtherExplain = res.retData.cOtherExplain;

            this.cApprovalSw = res.retData.cApprovalSw;
            this.cDenySw = res.retData.cDenySw;
            this.cPushbackAllSw = res.retData.cPushbackAllSw;
            this.cAddSw = res.retData.cAddSw;

            this.cWfType = res.retData.cWfType;

            this.authFileds = res.retData.authFileds;
            for(let i=0; i<this.authFileds.length; i++){
              if(this.authFileds[i].fieldKey == 'cPrcType'){
                let cpt = this.authFileds[i].fieldValue.split(",");
                this.typeList.push({value: ''+cpt[1],key:cpt[0]});
                this.type = cpt[0].trim();
                this.cPrcTypeRule.isDisplay = this.authFileds[i].isDisplay;
                this.cPrcTypeRule.isEdit = this.authFileds[i].isEdit;
                if(this.authFileds[i].isDisplay){
                  this.showProcessMoudle = true;
                }
              }else if(this.authFileds[i].fieldKey == 'cPrcDt'){
                let cpd = this.authFileds[i].fieldValue;
                this.date = cpd;
                this.cPrcDtRule.isDisplay = this.authFileds[i].isDisplay;
                this.cPrcDtRule.isEdit = this.authFileds[i].isEdit;
                if(this.authFileds[i].isDisplay){
                  this.showProcessMoudle = true;
                }
              }else if(this.authFileds[i].fieldKey == 'cAssmRslt'){
                let car = this.authFileds[i].fieldValue;
                this.cAssmRslt = car;
                this.cAssmRsltRule.isDisplay = this.authFileds[i].isDisplay;
                this.cAssmRsltRule.isEdit = this.authFileds[i].isEdit;
                if(this.authFileds[i].isDisplay){
                  this.showProcessMoudle = true;
                }
              }else if(this.authFileds[i].fieldKey == 'cIsAdj'){
                if(this.authFileds[i].fieldValue == 'Y'){
                  this.yesOrNo = 'Y';
                }else{
                  this.yesOrNo = 'N';
                };
                this.cIsAdjRule.isDisplay = this.authFileds[i].isDisplay;
                this.cIsAdjRule.isEdit = this.authFileds[i].isEdit;
                if(this.authFileds[i].isDisplay){
                  this.showProcessMoudle = true;
                }
              }else if(this.authFileds[i].fieldKey== 'cAdjuJobcode'){
                let caj = this.authFileds[i].fieldValue.split(",");
                this.jobList.push({value: ''+caj[1],key:caj[0]});
                this.job = caj[0].trim();
                this.cAdjuJobcodeRule.isDisplay = this.authFileds[i].isDisplay;
                this.cAdjuJobcodeRule.isEdit = this.authFileds[i].isEdit;
                if(this.authFileds[i].isDisplay){
                  this.showProcessMoudle = true;
                }
              }else if(this.authFileds[i].fieldKey== 'cAdjuSalary'){
                let csr = this.authFileds[i].fieldValue;
                this.cAdjuSalary = csr;
                this.cAdjuSalaryRule.isDisplay = this.authFileds[i].isDisplay;
                this.cAdjuSalaryRule.isEdit = this.authFileds[i].isEdit;
                if(this.authFileds[i].isDisplay){
                  this.showProcessMoudle = true;
                }
              }else if(this.authFileds[i].fieldKey== 'cBasePay'){
                let cby = this.authFileds[i].fieldValue;
                this.cBasePay = cby;
                this.cBasePayRule.isDisplay = this.authFileds[i].isDisplay;
                this.cBasePayRule.isEdit = this.authFileds[i].isEdit;
                if(this.authFileds[i].isDisplay){
                  this.showProcessMoudle = true;
                }
              }else if(this.authFileds[i].fieldKey== 'cPostWage'){
                let cpw = this.authFileds[i].fieldValue;
                this.cPostWage = cpw;
                this.cPostWageRule.isDisplay = this.authFileds[i].isDisplay;
                this.cPostWageRule.isEdit = this.authFileds[i].isEdit;
                if(this.authFileds[i].isDisplay){
                  this.showProcessMoudle = true;
                }
              }else if(this.authFileds[i].fieldKey== 'cOvertimePay'){
                let cop = this.authFileds[i].fieldValue;
                this.cOvertimePay = cop;
                this.cOvertimePayRule.isDisplay = this.authFileds[i].isDisplay;
                this.cOvertimePayRule.isEdit = this.authFileds[i].isEdit;
                if(this.authFileds[i].isDisplay){
                  this.showProcessMoudle = true;
                }
              }else if(this.authFileds[i].fieldKey == 'cMeritPay'){
                let cmp = this.authFileds[i].fieldValue;
                this.cMeritPay = cmp;
                this.cMeritPayRule.isDisplay = this.authFileds[i].isDisplay;
                this.cMeritPayRule.isEdit = this.authFileds[i].isEdit;
                if(this.authFileds[i].isDisplay){
                  this.showProcessMoudle = true;
                }
              }else if(this.authFileds[i].fieldKey== 'cIntervwRslts'){
                let cir = this.authFileds[i].fieldValue;
                this.cIntervwRslts = cir;
                this.cIntervwRsltsRule.isDisplay = this.authFileds[i].isDisplay;
                this.cIntervwRsltsRule.isEdit = this.authFileds[i].isEdit;
              }else if(this.authFileds[i].fieldKey== 'cLevelAbility'){
                let cla = this.authFileds[i].fieldValue.split(",");
                this.gradeList1.push({value: ''+cla[1],key:cla[0]});
                this.grade1 = cla[0].trim();
                this.cLevelAbilityRule.isDisplay = this.authFileds[i].isDisplay;
                this.cLevelAbilityRule.isEdit = this.authFileds[i].isEdit;
                if(this.authFileds[i].isDisplay){
                  this.showJudgeMoudle = true;
                }
              }else if(this.authFileds[i].fieldKey== 'cNoLevelAbility'){
                let cnla = this.authFileds[i].fieldValue.split(",");
                this.gradeList2.push({value: ''+cnla[1],key:cnla[0]});
                this.grade2 = cnla[0].trim();
                this.cNoLevelAbilityRule.isDisplay = this.authFileds[i].isDisplay;
                this.cNoLevelAbilityRule.isEdit = this.authFileds[i].isEdit;
                if(this.authFileds[i].isDisplay){
                  this.showJudgeMoudle = true;
                }
              }else if(this.authFileds[i].fieldKey== 'cWorkQualified'){
                let cwq = this.authFileds[i].fieldValue.split(",");
                this.gradeList3.push({value: ''+cwq[1],key:cwq[0]});
                this.grade3 = cwq[0].trim();
                this.cWorkQualifiedRule.isDisplay = this.authFileds[i].isDisplay;
                this.cWorkQualifiedRule.isEdit = this.authFileds[i].isEdit;
                if(this.authFileds[i].isDisplay){
                  this.showJudgeMoudle = true;
                }
              }else if(this.authFileds[i].fieldKey== 'cWorkAttitude'){
                let cwa = this.authFileds[i].fieldValue.split(",");
                this.gradeList4.push({value: ''+cwa[1],key:cwa[0]});
                this.grade4 = cwa[0].trim();
                this.cWorkAttitudeRule.isDisplay = this.authFileds[i].isDisplay;
                this.cWorkAttitudeRule.isEdit = this.authFileds[i].isEdit;
                if(this.authFileds[i].isDisplay){
                  this.showJudgeMoudle = true;
                }
              }else if(this.authFileds[i].fieldKey== 'cCmprEvalt'){
                let cce = this.authFileds[i].fieldValue.split(",");
                this.gradeList5.push({value: ''+cce[1],key:cce[0]});
                this.grade5 = cce[0].trim();
                this.cCmprEvaltRule.isDisplay = this.authFileds[i].isDisplay;
                this.cCmprEvaltRule.isEdit = this.authFileds[i].isEdit;
                if(this.authFileds[i].isDisplay){
                  this.showJudgeMoudle = true;
                }
              }else if(this.authFileds[i].fieldKey== 'cChargeComments'){
                let ccc = this.authFileds[i].fieldValue;
                this.cChargeComments = ccc;
                this.cChargeCommentsRule.isDisplay = this.authFileds[i].isDisplay;
                this.cChargeCommentsRule.isEdit = this.authFileds[i].isEdit;
                if(this.authFileds[i].isDisplay){
                  this.showJudgeMoudle = true;
                }
              }
            }
            if(this.yesOrNo && this.yesOrNo == 'N'){
              //如果是否调岗调薪是N，则不显示相应字段
              this.showAdjust = false;
            }else{
              this.showAdjust = true;
            }
          }else{
            this.$vux.alert.show({
              title: '',
              content: res.retMsg
            })
          }
        }).catch (res=>{
            this.$vux.alert.show({
              title: '警告',
              content: '网络异常，请稍后重试'
            })
        })
      },
      doOperate(actionType){
        if (actionType == 'PushAllback' || actionType == 'Pushback') {
          this.showGroup = !this.showGroup
        }
        window.event.cancelBubble = true;

        //判断必选项(转正类型，转正日期，直接上级评价)
        //存在再判断
        if(this.cPrcTypeRule.isDisplay){
          if(!this.type || this.type == ''){
            this.$vux.alert.show({
              title: '警告',
              content: '请选择转正类型'
            });
            return;
          }
        }

        if(this.cPrcDtRule.isDisplay){
          if(!this.date || this.date == ''){
            this.$vux.alert.show({
              title: '警告',
              content: '请选择转正日期'
            });
            return;
          }
        }

        if(this.cIntervwRsltsRule.isDisplay){
          if(!this.cIntervwRslts || this.cIntervwRslts == ''){
            this.$vux.alert.show({
              title: '警告',
              content: '请填写直接上级评价'
            });
            return;
          }
        }

        //同意，加签，驳回
        let params = {
          //TODO
          cTransactionNbr: this.cTransactionNbr,//流程编号
          actionType: actionType,
          comments: this.cComments,
          cLevelAbility: this.grade1,
          cNoLevelAbility: this.grade2,
          cWorkQualified: this.grade3,
          cWorkAttitude: this.grade4,
          cCmprEvalt: this.grade5,
          cChargeComments: this.cChargeComments,
          cIntervwRslts: this.cIntervwRslts,
          cMeritPay: this.cMeritPay,
          cOvertimePay: this.cOvertimePay,
          cPostWage: this.cPostWage,
          cBasePay: this.cBasePay,
          cAdjuSalary: this.cAdjuSalary,
          cAdjuJobcode: this.job,
          cIsAdj: this.yesOrNo,
          cAssmRslt: this.cAssmRslt,
          cPrcDt: this.date,
          cPrcType: this.type
        };
        if(actionType == 'AddStep'){//加签需要跳转至加签页面，并携带参数
          this.$router.push({
            name: 'Visa',
            params: {
              // c_TRANSACTION_NBR: this.cTransactionNbr,
              // c_WF_TYPE: this.cWfType,
              // c_COMMENTS: this.cComments,
              // c_Link: 'Formal',
              formalParams: params
            }
          })

        }else{
          getFormalApprove(json2Form(params)).then(res=>{
            if(res && res.retCode === '000000' ){
              let _this = this;
              this.$vux.alert.show({
                title: '成功',
                content: '操作成功',
                onHide () {
                  _this.$router.push("/TodoList");
                }
              })
          }else{
            this.$vux.alert.show({
              title: '',
              content: res.retMsg
            })
          }
        }).catch (res=>{
            this.$vux.alert.show({
            title: '警告',
            content: '网络异常，请稍后重试'
          })
        })
        }
      },
      popGroup() {
        this.showGroup = !this.showGroup
        window.event.cancelBubble = true
      },
      hideGroup() {
        this.showGroup = false
      },
      showOrHide(){
        if(this.yesOrNo == 'N'){
          this.showAdjust = false;
        }else{
          this.showAdjust = true;
        }
      }
    }
  }
</script>

<style type="text/scss" lang="scss">
@import '../../styles/staff.scss';
.reject-main {
  position: relative;
  .reject-group {
    position: absolute;
    top: -80px;
    left: 0px;
    button {
      margin-bottom: 1px;
    }
  }
}
.slide-fade-enter-active {
  transition: all 0.1s ease;
}
.slide-fade-leave-active {
  transition: all 0.2s cubic-bezier(1, 0.5, 0.8, 1);
}
.slide-fade-enter, .slide-fade-leave-to
/* .slide-fade-leave-active for below version 2.1.8 */ {
  transform: translateY(10px);
  opacity: 0;
}
</style>
